#pragma once

#include <vector>

class XThread;
class XTask;

class XThreadPool
{
public:
	static XThreadPool *get() {
		static XThreadPool p;
		return &p;
	}
	void init(int threadCount);
	void dispatch(XTask *task);
    ~XThreadPool();
private:
	XThreadPool();
private:
	int mThreadCount = 0;
	int mLastThread = -1;
	std::vector<XThread *>mThreads;
};

